<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>

       <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
              <link rel="stylesheet" href="css/public.css" />
       <title></title>

</head>
<body>


       <form action="index.php?r=login/upwd" method="post" enctype="multipart/form-data" onsubmit="return tijiao()" >

              <input type="hidden" name="Admin[email]" value="<?php echo $email ?>"/>
              <input type="hidden" name="Admin[key]" value="<?php echo $key ?>"/>

              <table class="table">
                     <tr>
                         <td class="th" colspan="2">修改密码</td>
                     </tr>
                     <tr>
                            <td>新密码</td>
                            <td>
                                   <input type="password" name="Admin[password]"  id="mima"  onblur="mimac()"/>
                                   <span id="mimas"></span>
                            </td>
                     </tr>
                     <tr>
                            <td>确认密码</td>
                            <td>
                                   <input type="password" name="Admin[pwd1]" id="queren" onblur="querenc()"/>
                                   <span id="querens"></span>
                            </td>
                      </tr>
                      <tr>
                            <td colspan="2">
                                   <input type="submit" value="确认" class="input_button"/>
                                   <input type="reset" class="input_button"/>
                            </td>
                     </tr>
              </table>
       </form>
</body>
<script>
       function tijiao(){
              if(!mimac()){
                     return false;
              }
              if(!querenc()){
                     return false;
              }
       }

       var mm=document.getElementById("mima");
       var mms=document.getElementById("mimas");
       function mimac(){
              mmm=mm.value;
              if(mm.value==""){
                     mms.innerHTML="密码不能为空";
                     mms.style.color="red";
                     return false ;
              }else{
                     mms.innerHTML="";
                     return true;
              }
       }
       var qr=document.getElementById("queren");
       var qrs=document.getElementById("querens");
       function querenc(){
              var qrqr=qr.value;
              var qqrr=mm.value;
              if(qr.value==""){
                     qrs.innerHTML="密码不能为空";
                     qrs.style.color="red";
                     return false;
              }
              else if(qrqr!=qqrr){
                     qrs.innerHTML="密码不一致";
                     qrs.style.color="red";
                     return false;
              }else{
                     qrs.innerHTML="";
                     return true;
              }
       }
</script>
</html>